package com.whz.singleton;

import java.io.Serializable;

/**
 * @Author: sinosoft
 * @Description: 单例模式 共有静态成员
 * @Date: Create in 18:32 2021/4/29
 * @Modified By:
 */
public class Elvis<T> implements Serializable {
    public static Elvis INSTANCE = new Elvis();
    private Elvis() {}
    public void leaveTheBuilding() {
        System.out.println("哈哈");
    }

    /*用来保存单例属性*/
    private Object readResolve() {
        System.out.println("");
        return INSTANCE;
    }

}
